(function () {
    'use strict';
    angular.module('module.login').config(configure);
    configure.$inject = ['$stateProvider'];

    function configure($stateProvider) {
        $stateProvider
            .state('home.login', {
                url: 'login',
                views: {
                    'content@': {
                        templateUrl: 'app/module/login/login.view.html',
                        controller: 'LoginController',
                        controllerAs: 'login',
                        resolve: {
                            deps: lazyLoadLogin
                        }
                    }
                },
                params: {
                    from: 'home.index'
                },
                data: {
                    pageTitle: '登录',
                    requiresLogin: false
                }
            });
    }

    lazyLoadLogin.$injector = ['$ocLazyLoad'];

    function lazyLoadLogin($ocLazyLoad) {
        return $ocLazyLoad.load({
            name: 'module.blank',
            insertBefore: '#ng_load_plugins_before',
            files: [
                'app/module/login/login.controller.js',
                'app/module/login/assets/css/login.css'
            ]
        });
    }
})();